<template>
  <!--  个性特征      -->
  <view
    class="allContainer"
    :style="[{ backgroundColor: isShowBgColor ? '#D9E2CC' : '#00000000' }]"
  >
    <view class="maskBox" />
    <image :src="img1" class="petalType" />
    <image class="textImg" :src="partTextImgUrl" />
    <image class="imgFloatRight" :src="imgPavilion" />
    <view
      class="contentView"
      :style="[{ paddingLeft: '32rpx' }, { paddingRight: '32rpx' }]"
    >
      <view class="contentBack">
        <view :style="[{ height: '204rpx' }]">
          <view v-for="(item, index) in lockInfo" :key="index">
            <view
              :style="[
                { marginTop: '30rpx' },
                { display: 'flex' },
                { alignItems: 'center' },
              ]"
            >
              <view class="blackBox"> </view>
              <view>
              <span
                :class="
                  titleItem.color == 1 ? 'smallTitleGreen' : 'smallTitleRed'
                "
                v-for="(titleItem, titleIndex) in item.title"
                :key="titleIndex"
                >{{ titleItem.label }}</span
              >
              </view>
            </view>

            <view class="onePartContent">{{ item.desc }}</view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  // components: {},
  props: {
    isShowBgColor: {
      type: Boolean,
      default: false,
    },

    textImgWidthRpx: {
      type: Number,
      default: 271,
    },

    textImgHeightRpx: {
      type: Number,
      default: 38,
    },

    contentPaddingLeftRpx: {
      type: Number,
      default: 48,
    },

    contentPaddingRightRpx: {
      type: Number,
      default: 200,
    },

    partTextImgUrl: {
      type: String,
      default:
        "https://img3.job1001.com/ypMp/elan/images/career/careerAssessNew/title1.png",
    },

    lockInfo: {
      type: Array,
      default() {
        return [
          {
            title: [
              { color: "1", label: "毕方教导你" },
              { color: "2", label: "调控热情赤焰，磨炼心气" },
            ],
            desc: "测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试",
          },
        ];
      },
    },
  },
  data() {
    return {
      img1: "https://img3.job1001.com/ypMp/elan/images/career/careerAssessResult/bg_part7_2.png",
      imgPavilion:
        "https://img3.job1001.com/ypMp/elan/images/career/careerAssessResult/img_pavilion.png",
    };
  },

  onReady() {},

  mounted() {
    uni
      .createSelectorQuery()
      .in(this)
      .select(".allContainer")
      .boundingClientRect((rect) => {
        console.log("rect.height = " + rect.height);
        this.$emit("listenRect", rect, 1);
      })
      .exec();
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.allContainer {
  position: relative;
  height: 430rpx;
  width: 100%;
  // background-image: url($img-base + "career/careerAssessResult/bg_part1.png");
  // background-repeat: no-repeat;
  //background-color: #D9E2CC;
}

.maskBox {
  width: 750rpx;
  height: 410rpx;
  position: absolute;
  top: 20rpx;
  z-index: 2;
  background: linear-gradient(#00000000, #c6d8c0);
  border-bottom: 1px solid #c6d8c0;
  background-clip: padding-box;
}

.contentView {
  z-index: 1;
  position: absolute;
  width: 100%;
  // padding-left: 48rpx;
  // padding-right: 200rpx;
  //  background-size: 380rpx 277rpx;
  // background-image: url($img-base + "career/careerAssessResult/img_pavilion.png");
  // background-repeat: no-repeat;
  //background-position: top right;
}

.textImg {
  height: 130rpx;
  width: 520rpx;
  image-rendering: -webkit-optimize-contrast;
  z-index: 9;
  position: relative;
}
.contentBack {
  position: relative;
  width: 100%;
  margin-top: -10rpx;
  background: linear-gradient(
    to bottom,
    #8de5ba 0%,
    #ccf0d7 50rpx,
    #f6f4df 80rpx,
    #f9f7e5 100%
  );
  padding: 20rpx 0 50rpx 0;
  border-radius: 0 15rpx 15rpx 15rpx;
}
.smallTitleGreen {
  font-size: 34rpx;
  font-family: Source Han Sans CN;
  font-weight: bold;
  color: #000;
  //line-height: 120rpx;
}
.blackBox {
  content: "";
  width: 10rpx;
  height: 38rpx;
  margin-top: 6rpx;
  margin-right: 20rpx;
  background: #000;
  color: #000;
  font-size: 26rpx;
}
.smallTitleRed {
  font-size: 34rpx;
  font-family: Source Han Sans CN;
  font-weight: bold;
  color: #ed5c22;
  //	line-height: 120rpx;
}
.petalType {
  position: absolute;
  width: 230rpx;
  height: 232rpx;
  right: 10rpx;
  top: -180rpx;
}
.imgFloatRight {
  position: absolute;
  width: 380rpx;
  height: 277rpx;
  right: 0rpx;
  top: 80rpx;
  z-index: 9;
}
.onePartContent {
  padding: 30rpx 30rpx 50rpx;
  font-size: 30rpx;
  //color: #555555;
  line-height: 37rpx;
  letter-spacing: 0rpx;

  background-clip: text;
  white-space: normal;
  word-break: break-all;
  display: -webkit-box;
  background-image: linear-gradient(#555555, #ff000000);
  -webkit-box-orient: vertical;
  /*设置省略号在容器第2行文本后*/
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}
</style>
